package com.hdq.mapper;

import entity.ImageClass;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ImageClassMapper {
    @Insert("insert into image_class (name, `order`) values (#{name},#{order})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void insert(ImageClass imageClass);

    @Select("select * from image_class order by `order` desc")
    List<ImageClass> selectPictureCategoryByPage();

    @Select("select * from image_class order by `order` desc")
    List<ImageClass> selectPictureCategory();



    @Update("update image_class set name=#{name},`order`=${order} where id = #{id}")
    void update(ImageClass imageClass);



    @Delete("delete from image_class where id = #{id}")
    void deleteImageCategory(Integer id);




}
